package com.lb.trac.web;

public class XmlColumnWrapper implements Comparable<XmlColumnWrapper>{
	
	
	private int order ;
	private String name;
	private String propertyName;
	
	
	
	public XmlColumnWrapper() {
		super();
	}
	
	
	public XmlColumnWrapper(int order, String name, String propertyName) {
		super();
		this.order = order;
		this.name = name;
		this.propertyName = propertyName;
	}


	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPropertyName() {
		return propertyName;
	}
	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}


	

	@Override
	public int compareTo(XmlColumnWrapper o) {
		return new Integer(getOrder()).compareTo(o.getOrder());
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + order;
		result = prime * result
				+ ((propertyName == null) ? 0 : propertyName.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		XmlColumnWrapper other = (XmlColumnWrapper) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (order != other.order)
			return false;
		if (propertyName == null) {
			if (other.propertyName != null)
				return false;
		} else if (!propertyName.equals(other.propertyName))
			return false;
		return true;
	}


	@Override
	public String toString() {
		return getName();
	}
	
	

}
